<?php
namespace App\Models\V1;
use DB;

class OrderModel{


    public function get_orders($type = '', $keywords = '')
    {
        $db = DB::table('wx_app_pay_log as a')
            ->leftJoin('memberinfo as b','b.UserID','=','a.user_id');

        if($type)
        {
            $db->where('a.goods_type',$type);
        }

        $orders = $db->where('a.pay_status',1)
            ->select('a.*','b.UserName','b.YourName')
            ->orderBy('a.id','desc')
            ->paginate();
        return $orders;
    }
}